from django.db import models

# Create your models here.


class Area(models.Model):
    """
    行政区划表, 省市区数据库
    """
    name = models.CharField(verbose_name='区域名', max_length=50)
    code = models.IntegerField('区域码', primary_key=True)
    area = models.ForeignKey('self', models.SET_NULL, 'subarea',
                             null=True, blank=True)

    class Meta:
        db_table = 'tb_areas'
        verbose_name = '行政区划表'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name




